<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Paperclip::ClassMethods</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Paperclip::ClassMethods</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/plugins/paperclip/lib/paperclip_rb.html">
                vendor/plugins/paperclip/lib/paperclip.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000058">attachment_definitions</a>&nbsp;&nbsp;
      <a href="#M000053">has_attached_file</a>&nbsp;&nbsp;
      <a href="#M000057">validates_attachment_content_type</a>&nbsp;&nbsp;
      <a href="#M000056">validates_attachment_presence</a>&nbsp;&nbsp;
      <a href="#M000054">validates_attachment_size</a>&nbsp;&nbsp;
      <a href="#M000055">validates_attachment_thumbnails</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name">InstanceMethods</span>
      </div>
    </div>

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000058" class="method-detail">
        <a name="M000058"></a>

        <div class="method-heading">
          <a href="#M000058" class="method-signature">
          <span class="method-name">attachment_definitions</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the attachment definitions defined by each call to <a
href="ClassMethods.html#M000053">has_attached_file</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000058-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip.rb, line 318</span>
318:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attachment_definitions</span>
319:       <span class="ruby-identifier">read_inheritable_attribute</span>(<span class="ruby-identifier">:attachment_definitions</span>)
320:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000053" class="method-detail">
        <a name="M000053"></a>

        <div class="method-heading">
          <a href="#M000053" class="method-signature">
          <span class="method-name">has_attached_file</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
<tt><a href="ClassMethods.html#M000053">has_attached_file</a></tt> gives
the class it is called on an attribute that maps to a file. This is
typically a file stored somewhere on the filesystem and has been uploaded
by a user. The attribute returns a <a
href="Attachment.html">Paperclip::Attachment</a> object which handles the
management of that file. The intent is to make the attachment as much like
a normal attribute. The thumbnails will be created when the new file is
assigned, but they will <b>not</b> be saved until <tt>save</tt> is called
on the record. Likewise, if the attribute is set to <tt>nil</tt> is called
on it, the attachment will <b>not</b> be deleted until <tt>save</tt> is
called. See the <a href="Attachment.html">Paperclip::Attachment</a>
documentation for more specifics. There are a number of options you can set
to change the behavior of a <a href="../Paperclip.html">Paperclip</a>
attachment:
</p>
<ul>
<li><tt>url</tt>: The full URL of where the attachment is publically
accessible. This can just as easily point to a directory served directly
through Apache as it can to an action that can control permissions. You can
specify the full domain and path, but usually just an absolute path is
sufficient. The leading slash <b>must</b> be included manually for absolute
paths. The default value is
&quot;/system/:attachment/:id/:style/:filename&quot;. See
Paperclip::Attachment#interpolate for more information on variable
interpolaton.

<pre>
  :url =&gt; &quot;/:class/:attachment/:id/:style_:filename&quot;
  :url =&gt; &quot;http://some.other.host/stuff/:class/:id_:extension&quot;
</pre>
</li>
<li><tt>default_url</tt>: The URL that will be returned if there is no
attachment assigned. This field is interpolated just as the url is. The
default value is &quot;/:attachment/:style/missing.png&quot;

<pre>
  has_attached_file :avatar, :default_url =&gt; &quot;/images/default_:style_avatar.png&quot;
  User.new.avatar_url(:small) # =&gt; &quot;/images/default_small_avatar.png&quot;
</pre>
</li>
<li><tt>styles</tt>: A hash of thumbnail styles and their geometries. You can
find more about geometry strings at the ImageMagick website (<a
href="http://www.imagemagick.org/script/command-line-options.php#resize">www.imagemagick.org/script/command-line-options.php#resize</a>).
<a href="../Paperclip.html">Paperclip</a> also adds the &quot;#&quot;
option (e.g. &quot;50x50#&quot;), which will resize the image to fit
maximally inside the dimensions and then crop the rest off (weighted at the
center). The default value is to generate no thumbnails.

</li>
<li><tt>default_style</tt>: The thumbnail style that will be used by default
URLs. Defaults to <tt>original</tt>.

<pre>
  has_attached_file :avatar, :styles =&gt; { :normal =&gt; &quot;100x100#&quot; },
                    :default_style =&gt; :normal
  user.avatar.url # =&gt; &quot;/avatars/23/normal_me.png&quot;
</pre>
</li>
<li><tt>whiny</tt>: Will raise an error if <a
href="../Paperclip.html">Paperclip</a> cannot post_process an uploaded file
due to a command line error. This will override the global setting for this
attachment. Defaults to true. This option used to be called
:whiny_thumbanils, but this is deprecated.

</li>
<li><tt>convert_options</tt>: When creating thumbnails, use this free-form
options field to pass in various convert command options. Typical options
are &quot;-strip&quot; to remove all Exif data from the image (save space
for thumbnails and avatars) or &quot;-depth 8&quot; to specify the bit
depth of the resulting conversion. See ImageMagick convert documentation
for more options: (<a
href="http://www.imagemagick.org/script/convert.php">www.imagemagick.org/script/convert.php</a>)
Note that this option takes a hash of options, each of which correspond to
the style of thumbnail being generated. You can also specify :all as a key,
which will apply to all of the thumbnails being generated. If you specify
options for the :original, it would be best if you did not specify
destructive options, as the intent of keeping the original around is to
regenerate all the thumbnails when requirements change.

<pre>
  has_attached_file :avatar, :styles =&gt; { :large =&gt; &quot;300x300&quot;, :negative =&gt; &quot;100x100&quot; }
                             :convert_options =&gt; {
                               :all =&gt; &quot;-strip&quot;,
                               :negative =&gt; &quot;-negate&quot;
                             }
</pre>
<p>
NOTE: While not deprecated yet, it is not recommended to specify options
this way. It is recommended that :convert_options option be included in the
hash passed to each :styles for compatability with future versions.
</p>
</li>
<li><tt>storage</tt>: Chooses the storage backend where the files will be
stored. The current choices are :filesystem and :s3. The default is
:filesystem. Make sure you read the documentation for <a
href="Storage/Filesystem.html">Paperclip::Storage::Filesystem</a> and <a
href="Storage/S3.html">Paperclip::Storage::S3</a> for backend-specific
options.

</li>
</ul>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000053-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip.rb, line 216</span>
216:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_attached_file</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {}
217:       <span class="ruby-identifier">include</span> <span class="ruby-constant">InstanceMethods</span>
218: 
219:       <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:attachment_definitions</span>, {}) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attachment_definitions</span>.<span class="ruby-identifier">nil?</span>
220:       <span class="ruby-identifier">attachment_definitions</span>[<span class="ruby-identifier">name</span>] = {<span class="ruby-identifier">:validations</span> =<span class="ruby-operator">&gt;</span> []}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
221: 
222:       <span class="ruby-identifier">after_save</span> <span class="ruby-identifier">:save_attached_files</span>
223:       <span class="ruby-identifier">before_destroy</span> <span class="ruby-identifier">:destroy_attached_files</span>
224: 
225:       <span class="ruby-identifier">define_callbacks</span> <span class="ruby-identifier">:before_post_process</span>, <span class="ruby-identifier">:after_post_process</span>
226:       <span class="ruby-identifier">define_callbacks</span> <span class="ruby-node">&quot;before_#{name}_post_process&quot;</span><span class="ruby-node">&quot;before_#{name}_post_process&quot;</span>, <span class="ruby-node">&quot;after_#{name}_post_process&quot;</span><span class="ruby-node">&quot;after_#{name}_post_process&quot;</span>
227:      
228:       <span class="ruby-identifier">define_method</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
229:         <span class="ruby-identifier">a</span> = <span class="ruby-identifier">attachment_for</span>(<span class="ruby-identifier">name</span>)
230:         (<span class="ruby-identifier">args</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">a</span>
231:       <span class="ruby-keyword kw">end</span>
232: 
233:       <span class="ruby-identifier">define_method</span> <span class="ruby-node">&quot;#{name}=&quot;</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
234:         <span class="ruby-identifier">attachment_for</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">assign</span>(<span class="ruby-identifier">file</span>)
235:       <span class="ruby-keyword kw">end</span>
236: 
237:       <span class="ruby-identifier">define_method</span> <span class="ruby-node">&quot;#{name}?&quot;</span> <span class="ruby-keyword kw">do</span>
238:         <span class="ruby-identifier">attachment_for</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">file?</span>
239:       <span class="ruby-keyword kw">end</span>
240: 
241:       <span class="ruby-identifier">validates_each</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">record</span>, <span class="ruby-identifier">attr</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
242:         <span class="ruby-identifier">attachment</span> = <span class="ruby-identifier">record</span>.<span class="ruby-identifier">attachment_for</span>(<span class="ruby-identifier">name</span>)
243:         <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:flush_errors</span>)
244:       <span class="ruby-keyword kw">end</span>
245:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000057" class="method-detail">
        <a name="M000057"></a>

        <div class="method-heading">
          <a href="#M000057" class="method-signature">
          <span class="method-name">validates_attachment_content_type</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Places ActiveRecord-style validations on the content type of the file
assigned. The possible options are:
</p>
<ul>
<li><tt>content_type</tt>: Allowed content types. Can be a single content type
or an array. Each type can be a String or a Regexp. It should be noted that
Internet Explorer upload files with content_types that you may not expect.
For example, JPEG images are given image/pjpeg and PNGs are image/x-png, so
keep that in mind when determining how you match. Allows all by default.

</li>
<li><tt>message</tt>: The message to display when the uploaded file has an
invalid content type.

</li>
<li><tt>if</tt>: A lambda or name of a method on the instance. Validation will
only be run is this lambda or method returns true.

</li>
<li><tt>unless</tt>: Same as <tt>if</tt> but validates if lambda or method
returns false.

</li>
</ul>
<p>
NOTE: If you do not specify an [attachment]_content_type field on your
model, content_type validation will work _ONLY upon assignment_ and
re-validation after the instance has been reloaded will always succeed.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000057-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip.rb, line 307</span>
307:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_attachment_content_type</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {}
308:       <span class="ruby-identifier">types</span> = [<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:content_type</span>)].<span class="ruby-identifier">flatten</span>
309:       <span class="ruby-identifier">validates_each</span>(<span class="ruby-node">&quot;#{name}_content_type&quot;</span><span class="ruby-node">&quot;#{name}_content_type&quot;</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">record</span>, <span class="ruby-identifier">attr</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
310:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">types</span>.<span class="ruby-identifier">any?</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">value</span> }
311:           <span class="ruby-identifier">record</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-node">&quot;#{name}_content_type&quot;</span><span class="ruby-node">&quot;#{name}_content_type&quot;</span>, <span class="ruby-identifier">:inclusion</span>, <span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span>)
312:         <span class="ruby-keyword kw">end</span>
313:       <span class="ruby-keyword kw">end</span>
314:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000056" class="method-detail">
        <a name="M000056"></a>

        <div class="method-heading">
          <a href="#M000056" class="method-signature">
          <span class="method-name">validates_attachment_presence</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Places ActiveRecord-style validations on the presence of a file. Options:
</p>
<ul>
<li><tt>if</tt>: A lambda or name of a method on the instance. Validation will
only be run is this lambda or method returns true.

</li>
<li><tt>unless</tt>: Same as <tt>if</tt> but validates if lambda or method
returns false.

</li>
</ul>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000056-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip.rb, line 283</span>
283:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_attachment_presence</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {}
284:       <span class="ruby-identifier">message</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:message</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;must be set.&quot;</span>
285:       <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-node">&quot;#{name}_file_name&quot;</span><span class="ruby-node">&quot;#{name}_file_name&quot;</span>, 
286:                             <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">message</span>,
287:                             <span class="ruby-identifier">:if</span>      =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:if</span>],
288:                             <span class="ruby-identifier">:unless</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:unless</span>]
289:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000054" class="method-detail">
        <a name="M000054"></a>

        <div class="method-heading">
          <a href="#M000054" class="method-signature">
          <span class="method-name">validates_attachment_size</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Places ActiveRecord-style validations on the size of the file assigned. The
possible options are:
</p>
<ul>
<li><tt>in</tt>: a Range of bytes (i.e. +1..1.megabyte+),

</li>
<li><tt>less_than</tt>: equivalent to :in =&gt; 0..options[:less_than]

</li>
<li><tt>greater_than</tt>: equivalent to :in =&gt;
options[:greater_than]..Infinity

</li>
<li><tt>message</tt>: error message to display, use :min and :max as
replacements

</li>
<li><tt>if</tt>: A lambda or name of a method on the instance. Validation will
only be run is this lambda or method returns true.

</li>
<li><tt>unless</tt>: Same as <tt>if</tt> but validates if lambda or method
returns false.

</li>
</ul>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000054-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip.rb, line 256</span>
256:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_attachment_size</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {}
257:       <span class="ruby-identifier">min</span>     = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:greater_than</span>] <span class="ruby-operator">||</span> (<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:in</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:in</span>].<span class="ruby-identifier">first</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
258:       <span class="ruby-identifier">max</span>     = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:less_than</span>]    <span class="ruby-operator">||</span> (<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:in</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:in</span>].<span class="ruby-identifier">last</span>)  <span class="ruby-operator">||</span> (<span class="ruby-value">1.0</span><span class="ruby-operator">/</span><span class="ruby-value">0</span>)
259:       <span class="ruby-identifier">range</span>   = (<span class="ruby-identifier">min</span><span class="ruby-operator">..</span><span class="ruby-identifier">max</span>)
260:       <span class="ruby-identifier">message</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:message</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;file size must be between :min and :max bytes.&quot;</span>
261:       <span class="ruby-identifier">message</span> = <span class="ruby-identifier">message</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/:min/</span>, <span class="ruby-identifier">min</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/:max/</span>, <span class="ruby-identifier">max</span>.<span class="ruby-identifier">to_s</span>)
262: 
263:       <span class="ruby-identifier">validates_inclusion_of</span> <span class="ruby-node">&quot;#{name}_file_size&quot;</span><span class="ruby-node">&quot;#{name}_file_size&quot;</span>,
264:                              <span class="ruby-identifier">:in</span>      =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">range</span>,
265:                              <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">message</span>,
266:                              <span class="ruby-identifier">:if</span>      =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:if</span>],
267:                              <span class="ruby-identifier">:unless</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:unless</span>]
268:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000055" class="method-detail">
        <a name="M000055"></a>

        <div class="method-heading">
          <a href="#M000055" class="method-signature">
          <span class="method-name">validates_attachment_thumbnails</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Adds errors if thumbnail creation fails. The same as specifying
:whiny_thumbnails =&gt; true.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000055-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/paperclip/lib/paperclip.rb, line 271</span>
271:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_attachment_thumbnails</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {}
272:       <span class="ruby-identifier">warn</span>(<span class="ruby-value str">'[DEPRECATION] validates_attachment_thumbnail is deprecated. '</span> <span class="ruby-operator">+</span>
273:            <span class="ruby-value str">'This validation is on by default and will be removed from future versions. '</span> <span class="ruby-operator">+</span>
274:            <span class="ruby-value str">'If you wish to turn it off, supply :whiny =&gt; false in your definition.'</span>)
275:       <span class="ruby-identifier">attachment_definitions</span>[<span class="ruby-identifier">name</span>][<span class="ruby-identifier">:whiny_thumbnails</span>] = <span class="ruby-keyword kw">true</span>
276:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>